Method and system for xml multi-transform

ABSTRACT

A method of performing XSLT processing is disclosed herein disclosed. The method comprises defining a binary tree, each node representing either an XML document or XSLT stylesheet, each leaf representing a an existing file, and each non-leaf node having two child nodes, one representing an XML document, and one representing an XSLT stylesheet, performing a post-order traversal of the binary tree, each non-leaf node being constructed by transforming the non-leaf node&#39;s respective XML document child node using the non-leaf node&#39;s respective XSLT stylesheet to create the non-leaf node, and creating a final text document as the root node.

REFERENCE TO RELATED APPLICATIONS

This application claims priority to U.S. Provisional Patent Application No. 60/827,111, filed Sep. 27, 2006, and entitled “XML Multi-Transform.”

BACKGROUND

The extensible markup language (XML) is a general purpose markup language. Extensible stylesheet language (XSL) transformation (XSLT) is a language that translates one XML document into another XML document, allowing for chained translations. XSLT is itself an XML document and may be generated from another XSLT transformation. Current extensible stylesheet language (XSL) transformation (XSLT) processing is limited to one extensible markup language (XML) document processed by one XSLT document. In general, custom applications are required in order to perform multiple transformations of XML when multiple translations need to be performed. These custom applications tend to be relatively complex, relative expensive, and have long development cycles.

Thus, there is a need for a method and system of XSLT processing that is not limited to a single XML document processed by a single XSLT document.

SUMMARY

Before the present methods are described, it is to be understood that this invention is not limited to the particular methodologies or protocols described, as these may vary. It is also to be understood that the terminology used herein is for the purpose of describing particular embodiments only, and is not intended to limit the scope of the present disclosure, which will be limited only by the appended claims.

It must be noted that as used herein and in the appended claims, the singular forms “a,” “an,” and “the” include plural reference unless the context clearly dictates otherwise. Thus, for example, reference to a “transaction” is a reference to one or more transactions and equivalents thereof known to those skilled in the art, and so forth. Unless defined otherwise, all technical and scientific terms used herein have the same meanings as commonly understood by one of ordinary skill in the art. Although any methods and materials similar or equivalent to those described herein can be used in the practice or testing of the present invention, the preferred methods, devices, and materials are now described. All publications mentioned herein are incorporated herein by reference. Nothing herein is to be construed as an admission that the invention is not entitled to antedate such disclosure by virtue of prior invention.

In an embodiment, a method of performing XSLT processing is hereinafter disclosed. The method comprises defining a binary tree, each node representing either an XML document or XSLT stylesheet, each leaf representing a an existing file, and each non-leaf node having two child nodes, one representing an XML document, and one representing an XSLT stylesheet, performing a post-order traversal of the binary tree, each non-leaf node being constructed by transforming the non-leaf node's respective XML document child node using the non-leaf node's respective XSLT stylesheet to create the non-leaf node, and creating a final text document as the root node.

BRIEF DESCRIPTION OF THE DRAWINGS

Aspects, features, benefits and advantages of the present invention will be apparent with regard to the following description and accompanying drawings, of which:

FIG. 1 depicts an exemplary data structure according to an embodiment

FIG. 2 depicts an exemplary binary tree corresponding to the data structure of FIG. 1 according to a preferred embodiment.

FIG. 3 depicts a flow diagram for an exemplary method of processing XML utilizing XSLT according to an embodiment.

DETAILED DESCRIPTION

FIG. 1 illustrates various embodiments of a data structure 10 for representing multiple nested XSL transforms as a binary tree. The binary tree may be represented in an XML format with a schema comprising a root tag 12, and four additional tags under the root tag 12. The four tags comprise a transform tag 14, an XML tag 16, and XSL tag 18, and a parameter tag 20. The transform tag 14 may hold one XML tag 16, one XSL tag 18, and any number of parameter tags 20. Each XML tag 14 may specify either a file (i.e., a leaf node) or may have a transform tag 14 underneath it. Similarly, each XSL tag 16 may specify either a file (i.e., a leaf node) or may have a transform tag 14 underneath it. The transform tags 14 underneath the XML tag 16 may comprise XML tags 16 and/or XSL tags 18.

The data structure 10 may represent any number of chained or piped XSLT transformations in a declarative fashion as a binary tree comprising interconnected nodes. In a preferred embodiment, for a given parent node, one child may be an XML document, one child may be an XSLT sheet, and the parent node may be a resultant XML document. Or XSLT sheet The parent node can then itself be an XML child node or an XSLT child node of another parent node. Nodes without children may be considered leaf nodes. The only node without a parent is the top node, and may be considered the root node of the binary tree. Each node may have one or two children. Before the commencement of the method disclosed hereinafter, only the leaf nodes are guaranteed to exist at the beginning of the disclosed method. The intermediate files may be created on-the-fly, as hereinafter disclosed. The data structure 10 makes processing large numbers of XML documents more convenient. A simplified example of a binary tree 30 corresponding to the data structure 10 of FIG. 1 is illustrated in FIG. 2. In the binary tree 30, each “X” represents an XML document, each “S” represents an XSLT stylesheet, and “F” represents the final text document.

FIG. 3 illustrates a method of XML processing using XSLT according to a preferred embodiment. In general, the method may be used for any application in which XML processing with XSLT may be useful. For example, the method may be used for report generation, data manipulation, graphics, web page generation, etc. First, a binary tree comprising one or more XML documents and multiple nest XSL transforms is defined 110. According to an embodiment, the binary tree may be defined using a structure similar to the data structure of FIG. 1. Then, XML document and XSL sheet transformations are performed 120 with a post-order tree traversal to generate a final text document at the root node of the binary node. In the post-order tree traversal, one of the chained or piped XSLT transforms operates on an XML document to generate a different XML document or XSLT transform, and so on throughout the post-order tree traversal process. Any number of transformations may be performed to generate the final text document.

Using the binary tree 30 as an example, the post-order tree traversal proceeds as follows. First, the left child “X1” is operated on by the right child “S1” to generate the parent “X3.” Then, the left child “X2” is operated on by the right child “S2” to generate the parent “S3.” Then, “X3” is operated on by “S3” to produce the final text document, “F.”

The above method may be implemented in, for example, hardware or firmware. The method may be implemented as a software application using any programming language and may be embodied permanently or temporarily in any type of machine, component, physical or virtual equipment, storage medium, or propagated signal capable of delivering instructions. The software code may be stored on a computer readable medium such as magnetic or optical memory devices.

It will be appreciated that various of the above-disclosed and other features and functions, or alternatives thereof, may be desirably combined into many other different systems or applications. It will also be appreciated that various presently unforeseen or unanticipated alternatives, modifications, variations or improvements therein may be subsequently made by those skilled in the art which are also intended to be encompassed by the disclosed embodiments. 

1. A method for performing XSLT processing, the method comprising: defining a binary tree, each node representing either an XML document or XSLT stylesheet, each leaf representing a an existing file, and each non-leaf node having two child nodes, one representing an XML document, and one representing an XSLT stylesheet; performing a post-order traversal of the binary tree, each non-leaf node being constructed by transforming the non-leaf node's respective XML document child node using the non-leaf node's respective XSLT stylesheet to create the non-leaf node; and creating a final text document as the root node.
 2. The method of claim 1, wherein the binary tree is represented as an XML document.
 3. The method of claim 1, wherein the binary tree contains at least two nodes representing XML documents and two nodes representing XSLT documents.
 4. The method of claim 1, wherein the final text document is a report.
 5. The method of claim 1, wherein the final text document is a web page.
 6. A computer-readable storage medium comprising instructions for causing a programmable processor to: define a binary tree, each node representing either an XML document or XSLT stylesheet, each leaf representing a an existing file, and each non-leaf node having two child nodes, one representing an XML document, and one representing an XSLT stylesheet; perform a post-order traversal of the binary tree, each non-leaf node being constructed by transforming the non-leaf node's respective XML document child node using the non-leaf node's respective XSLT stylesheet to create the non-leaf node; and create a final text document as the root node.
 7. The computer-readable storage medium of claim 6, wherein the binary tree is represented as an XML document.
 8. The computer-readable storage medium of claim 6, wherein the binary tree contains at least two nodes representing XML documents and two nodes representing XSLT documents.
 9. The computer-readable storage medium of claim 6, wherein the final text document is a report.
 10. The computer-readable storage medium of claim 6, wherein the final text document is a web page. 